<template>
	<view style="position: absolute;width: 100%;height: 100%;background-color: #eee;left: 0;top: 0;">
		<view style="height: 300upx;background-color: #007aff;text-align: center;display: flex;align-items: center;justify-content: center;flex-direction: column;">
			<image :src="user.head_url||'../../static/img/sending.png'" mode="aspectFit" style="width: 100upx;height: 100upx;vertical-align: middle;border-radius: 50%;"></image>
			<view style="color: #fff;">{{user.user_nick||'昵称'}}</view>
		</view>
		<!-- <view class="lines">
			<view class="inp-line">
				<image class="icon" src="../../static/img/paying.png" mode="scaleToFill"></image>
				<view class="title">待付款</view>
			</view>
			<view class="inp-line">
				<image class="icon" src="../../static/img/sending.png" mode="scaleToFill"></image>
				<view class="title">待发货</view>
			</view>
			<view class="inp-line">
				<image class="icon" src="../../static/img/complete.png" mode="scaleToFill"></image>
				<view class="title">已完成</view>
			</view>
			<view class="inp-line" @tap="goOrder(1)">
				<image class="icon" src="../../static/img/allOrder.png" mode="scaleToFill"></image>
				<view class="title">全部订单</view>
			</view>
		</view> -->
		<view class="card" style="">
			<image src="http://jzkj02.oss-cn-hangzhou.aliyuncs.com/file/K7M1600660240098.png" mode="widthFix" 
				style="width: 60upx;vertical-align: middle;margin-right: 20upx;"></image>
			白银坤瑞恒建材
		</view>
		<view class="lines">
			<view class="inp-line" @tap="goOrder(1)">
				<image class="icon" src="../../static/img/allOrder.png" mode="scaleToFill"></image>
				<view class="title">我的订单</view>
			</view>
			<view class="inp-line" @tap="openLocation">
				<image class="icon" src="../../static/img/navigation.png" mode="scaleToFill"></image>
				<view class="title">门店导航</view>
			</view>
			<view class="inp-line" @tap="call">
				<image class="icon" src="../../static/img/serve-a.png" mode="scaleToFill"></image>
				<view class="title">客服电话</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile: '',
				user: {}
			};
		},
		methods:{
			chooseAddress(){
				uni.navigateTo({
					url: '/pages/main/address/address'
				})
			},
			goOrder(num){
				uni.navigateTo({
					url: '/pages/main/order/order?id='+num
				})
			},
			openLocation(){
				uni.openLocation({
				    latitude: 36.763069,
				    longitude: 104.836254,
					address: '白银坤瑞恒建材有限公司',
				    success: function () {
				        console.log('success');
				    }
				});
			},
			call(){
				uni.makePhoneCall({
					phoneNumber: '13519011555'
				})
			},
		},
		onShow() {
			this.user = this.config.globalData.user
		},
		mounted() {
			this.config.getLoginInfo();
			this.user = this.config.globalData.user
			uni.$on('userInfo', ()=>{
				this.user = this.config.globalData.user
			})
			console.log(this.user)
		}
	}
</script>

<style lang="less" scoped>
	.lines{
		display: flex;
		justify-content: space-around;
		padding: 30upx 0;
		background-color: #fff;
		margin-bottom: 30upx;
		.inp-line{
			font-size: 26upx;
			text-align: center;
			.icon{
				width: 60upx;height: 60upx;
			}
		}
	}
	.card{
		margin: -50upx 50upx 30upx;
		border-radius: 10upx;
		text-align: center;
		padding: 40upx 0;
		box-shadow: 0 0 10upx 0 #999;
		z-index: 10;
		background-color: #fff;
	}
</style>
